package com.bwie.utils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @program: day0423-unit3
 * @ClassName R
 * @description:
 * @author: 段阳
 * @create: 2024-04-23 08:42
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class R {

    private String message;
    private Boolean flag;
    private int code;
    private Object data;

    public static R success(String message,Object data){
        return new R(message,true,200,data);
    }
    public static R success(String message){
        return new R(message,true,200,null);
    }

    public static R error(int code ,String message){
        return new R(message,false,code,null);
    }


}